package qldc.pm.tienan.searchcontainer.util.congdan;

import com.liferay.portal.kernel.util.OrderByComparator;

public class CongDanComparatorUtil {
	public static OrderByComparator getCongDanOrderByComparator(String orderByCol, String orderByType) {
		boolean orderByAsc = false;

		if(orderByType.equals("asc")) {
			orderByAsc = true;
		}

		OrderByComparator orderByComparator = null;

		if(orderByCol.equals("soDinhDanhCaNhan")) {
			orderByComparator = new CongDanSoDinhDanhCaNhanComparator(orderByAsc);
		} else if(orderByCol.equals("hoVaTen")) {
			orderByComparator = new CongDanHoVaTenComparator(orderByAsc);
		} else if(orderByCol.equals("soCMND")) {
			orderByComparator = new CongDanSoCMNDComparator(orderByAsc);
		} else if(orderByCol.equals("soSoHoKhau")) {
			orderByComparator = new CongDanSoSoHoKhauComparator(orderByAsc);
		}

		return orderByComparator;
	}
}
